package com.woniuxy.topic.service.impl;

import com.woniuxy.pojo.TopicMail;
import com.woniuxy.topic.service.TopicService;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TopicServiceImpl implements TopicService {

    @Autowired
    RabbitTemplate rabbitTemplate;


    @Override
    public void sendMessage(TopicMail mail) {
        rabbitTemplate.convertAndSend("topicEx",mail.getRoutingkey(),mail);
    }
}
